<?php


namespace app\common\service\lib\Pay;


class AliPay implements PayInterface
{

    /**
     * Author:YangXinPeng
     * 支付入口
     * @param $param
     * @return mixed|\Symfony\Component\HttpFoundation\Response
     */
    public function doAction($param)
    {
        $pay = AliPayFactory::createMode($param);
        return $pay->send();
    }

    /**
     * Author:YangXinPeng
     * 记录支付日志
     * @return mixed|void
     */
    public function payLog()
    {
        // TODO: Implement payLog() method.
    }

    /**
     * Author:YangXinPeng
     * 支付订单退款
     * @param $params
     * @return array
     * @throws \Yansongda\Pay\Exceptions\GatewayException
     * @throws \Yansongda\Pay\Exceptions\InvalidConfigException
     * @throws \Yansongda\Pay\Exceptions\InvalidSignException
     */
    public function refund($params)
    {
      return AliPayFactory::refund($params);
    }

    /**
     * Author:YangXinPeng
     * 支付订单查询
     * @param $params
     * @return \Yansongda\Supports\Collection
     * @throws \Yansongda\Pay\Exceptions\GatewayException
     * @throws \Yansongda\Pay\Exceptions\InvalidConfigException
     * @throws \Yansongda\Pay\Exceptions\InvalidSignException
     */
    public function find($params)
    {
     return AliPayFactory::find($params);
    }
}